<% layout('/layouts/list.html', {title: @MessageUtils.getMessage('sys.user.title',''), libs: 'bootstrap-treeview'}){ %>
<div class="row">
	<div class="col-sm-3 col-md-2" >
		<#view:treeview id="organizationTreeview" dataUrl="${adminPath}/sys/organization/bootstrapTreeData" onNodeSelected="organizationOnclick"/>
		<script type="text/javascript">
            function organizationOnclick(event, node) {
                //查询时间
                //gridquery隐藏 查询标签概念，query,单独的query
                $("input[name='organizationid']").val(node.href);
                search('userGrid');
            }
		</script>
	</div>
	<div  class="col-sm-9 col-md-10">
		<#grid:grid id="userGrid" url="${adminPath}/sys/user/ajaxList">
			<#grid:column label="sys.common.key" hidden="true"   name="id" width="100"/>
			<#grid:column label="sys.common.opt"  name="opt" formatter="button" width="100"/>
			<#grid:button groupname="opt" function="delete"/>
			<#grid:query name="organizationid"  queryMode="hidden" />
			<#grid:column label="sys.user.realname"  name="realname"  query="true"  condition="like" />
			<#grid:column label="sys.user.username"  name="username"  query="true" condition="like"   />
			<#grid:column label="sys.user.email"  name="email"  />
			<#grid:column label="sys.user.phone"  name="phone"  />
			<#grid:toolbar title="sys.user.adduser" function="add"/>
			<#grid:toolbar title="sys.user.updateuser" function="update"/>
			<#grid:toolbar title="sys.user.modifypwd" icon="fa-database"  function="updateDialog" url="${adminPath}/sys/user/{id}/changePassword"  />
			<#grid:toolbar title="导出"   icon="fa-download"  onclick="download()"  />
			<#grid:toolbar function="delete"/>
			<#grid:toolbar  function="search"/>
			<#grid:toolbar  function="reset"/>
		</#grid:grid>
		<script>
            /**
             * 导出
             * @param rowId
             */
            function download() {
                excelExport("${adminPath}/sys/user/export","userGrid");
            }
		</script>
	</div>
</div>
<% } %>